﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterNhanSuTienLuong.Master" Inherits="System.Web.Mvc.ViewPage<DTTB.MV2.QUANLYNHANSUTIENLUONG.Models.FormBean.ChamCongModel.ThoiKhoaBieuChamCongForm>" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <link href="<%= ResolveUrl("~/Content/Styles/fullcalendar.css") %>" rel="stylesheet" type="text/css" />
    <link href="<%= ResolveUrl("~/Content/Styles/fullcalendar.print.css") %>" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="<%= ResolveUrl("~/Content/Scripts/fullcalendar.min.js") %>"></script>
    <script type="text/javascript" language="javascript" src="<%= ResolveUrl("~/Content/Scripts/ChamCong/ThoiKhoaBieuChamCong.js") %>"></script>
    <script language ="javascript" type="text/javascript">
        $(document).ready(function () {
            $("#FromDate").datepicker({ dateFormat: 'dd/mm/yy' });
        });
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="box">
    <div class="breadcrumbs">
            <ul>
                <li class="home"><a href="">Quản lý chấm công</a></li>
                <li><a href="">Lịch chấm công nhân viên </a></li>
            </ul>
        </div>
        <div class="headlines">
            <h2>
            &nbsp;<%=Model.ThangCham%>/<%=Model.NamDuocCham%> - Từ ngày <%=Model.TuNgayCham%> đến ngày <%=Model.DenNgayCham%>
            </h2>
        </div>
        <div class="box-content formBox">
        <div style="padding-left: auto;  padding-right: auto;">
            <div id="calendarTest" style="margin: auto; width: 95%;">
            </div>
        </div>
        <div>
             <div id="Message" class="Message" style="font-size: 12px; color: Blue; font-weight: bold">
                    <%=Model.Message%>
                </div>
        </div>
        <div class="divhome">
           Chấm công theo ngày
        </div>
        <div class="divhomeLichLamViec">
            <table style="width: 100%">
                <tr>
                    <td colspan="4">
                        <span style="display: inline;">Chọn ngày</span>
                        <input name="FromDate" id="FromDate" value="<%=!string.IsNullOrEmpty(Model.NgayDuocChon)?Model.NgayDuocChon:DateTime.Today.ToString("dd/MM/yyyy")%>" style="display: inline;" />
                        <%--<%= Model.FromDate != null ? Model.FromDate.Value.ToString("dd/MM/yyyy") : DateTime.Now.ToString("dd/MM/yyyy") %><span style="display:inline; margin-left: 40px;">Đến ngày</span>
                        <input name="ToDate" id="ToDate" 
                            value="<%= Model.ToDate != null ? Model.ToDate.Value.ToString("dd/MM/yyyy") : DateTime.Now.AddDays(3).ToString("dd/MM/yyyy") %>" 
                            style="display: inline;" />
                            
                            --%>
                        <input type="button" value="Xem" onclick="javascript:DoView();" style="display: inline;" />
                        <div class="red" id="msg-FormDate"></div>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <div id="LichChuyenVien">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        
                    </td>
                </tr>
                <tr>
                    <td>
                        <div id="Div1">
                            <table cellspacing="0" cellpadding="0" border="1" width="100%" class="table_home">
                                    <tr>
                                        <td nowrap="nowrap" align="center">
                                            <strong>STT</strong>
                                        </td>
                                        <td nowrap="nowrap" align="center">
                                            <strong>Họ</strong>
                                        </td>
                                        <td nowrap="nowrap" align="center">
                                            <strong>Tên</strong>
                                        </td>
                                        <td nowrap="nowrap" align="center">
                                            <strong>Thứ hai - <%=Model.NgayThu2%> </strong>
                                        </td>
                                        <td nowrap="nowrap" align="center">
                                            <strong>Thứ ba - <%=Model.NgayThu3%></strong>
                                        </td>
                                        <td nowrap="nowrap" align="center">
                                            <strong>Thứ tư - <%=Model.NgayThu4%> </strong>
                                        </td>
                                        <td nowrap="nowrap" align="center">
                                            <strong>Thứ năm - <%=Model.NgayThu5%></strong>
                                        </td>
                                        <td nowrap="nowrap" align="center">
                                            <strong>Thứ sáu - <%=Model.NgayThu6%> </strong>
                                        </td>
                                        <td nowrap="nowrap" align="center">
                                            <strong>Thứ bảy - <%=Model.NgayThu7%> </strong>
                                        </td>
                                        <td nowrap="nowrap" align="center">
                                            <strong>Chủ nhật - <%=Model.NgayThu8%></strong>
                                        </td>
                                    </tr>
                                     <tbody>
                                    <%   
                                        int stt = (Model.PageNumber - 1) * DTTB.Common.CommonVariables.PaggedItemsPerPage + 1;
                                        if (Model.ListDanhSachNhanVienCanChamCong !=null && Model.ListDanhSachNhanVienCanChamCong.Count > 0)
                                        {
                                            foreach (DTTB.MV2.QUANLYNHANSUTIENLUONG.Models.FormBean.ChamCongModel.BaseNhanVienTrongChamCong item in Model.ListDanhSachNhanVienCanChamCong)
                                                {
                                                    if (item.ListDuLieuChamCongTrongThang.Count > 0)
                                                    {
                                                %>
                                          <tr>
                                        <td nowrap="nowrap" align="center">
                                           <%=stt%>
                                        </td>
                                        <td nowrap="nowrap" style="padding-left: 5px; text-align:left;">
                                            <%=item.Ho%>
                                        </td>
                                        <td nowrap="nowrap" style="text-align:center" >
                                            <%=item.Ten%>
                                        </td>
                                        <td class="TableHover" title="<%=item.ListDuLieuChamCongTrongThang[0].TenKyHieu%> và số giờ tăng ca là: <%=item.ListDuLieuChamCongTrongThang[0].SoGioTangCa%>" style="text-align:center; cursor:pointer;<%if(Model.TheHienMauChoNgay ==1 ){%> background-color:#ffffcc;<%}%>" onclick="javascript:ChamCongNgayHomNay('<%=Model.NgayThu2%>');">
                                         <%=item.ListDuLieuChamCongTrongThang[0].KyHieuChamCong%> / <%=item.ListDuLieuChamCongTrongThang[0].SoGioTangCa%>
                                        </td>
                                        <td class="TableHover" title="<%=item.ListDuLieuChamCongTrongThang[1].TenKyHieu%> và số giờ tăng ca là: <%=item.ListDuLieuChamCongTrongThang[1].SoGioTangCa%>" style="text-align:center;cursor:pointer; <%if(Model.TheHienMauChoNgay ==2 ){%>background-color:#ffffcc;<%}%>" onclick="javascript:ChamCongNgayHomNay('<%=Model.NgayThu3%>');">
                                        <%=item.ListDuLieuChamCongTrongThang[1].KyHieuChamCong%> / <%=item.ListDuLieuChamCongTrongThang[1].SoGioTangCa%>
                                        </td>
                                        <td class="TableHover"  title="<%=item.ListDuLieuChamCongTrongThang[2].TenKyHieu%> và số giờ tăng ca là: <%=item.ListDuLieuChamCongTrongThang[2].SoGioTangCa%>" style="text-align:center;cursor:pointer;<%if(Model.TheHienMauChoNgay ==3 ){%> background-color:#ffffcc;<%}%>" onclick="javascript:ChamCongNgayHomNay('<%=Model.NgayThu4%>');">
                                        <%=item.ListDuLieuChamCongTrongThang[2].KyHieuChamCong%> / <%=item.ListDuLieuChamCongTrongThang[2].SoGioTangCa%>
                                        </td>
                                        <td class="TableHover" title="<%=item.ListDuLieuChamCongTrongThang[3].TenKyHieu%> và số giờ tăng ca là: <%=item.ListDuLieuChamCongTrongThang[3].SoGioTangCa%>" style="text-align:center;cursor:pointer;<%if(Model.TheHienMauChoNgay ==4 ){%> background-color:#ffffcc;<%}%>" onclick="javascript:ChamCongNgayHomNay('<%=Model.NgayThu5%>');">
                                        <%=item.ListDuLieuChamCongTrongThang[3].KyHieuChamCong%> / <%=item.ListDuLieuChamCongTrongThang[3].SoGioTangCa%>
                                        </td>
                                        <td class="TableHover" title="<%=item.ListDuLieuChamCongTrongThang[4].TenKyHieu%> và số giờ tăng ca là: <%=item.ListDuLieuChamCongTrongThang[4].SoGioTangCa%>" style="text-align:center;cursor:pointer;<%if(Model.TheHienMauChoNgay ==5 ){%> background-color:#ffffcc;<%}%>" onclick="javascript:ChamCongNgayHomNay('<%=Model.NgayThu6%>');">
                                        <%=item.ListDuLieuChamCongTrongThang[4].KyHieuChamCong%> / <%=item.ListDuLieuChamCongTrongThang[4].SoGioTangCa%>
                                        </td>
                                        <td class="TableHover" title="<%=item.ListDuLieuChamCongTrongThang[5].TenKyHieu%> và số giờ tăng ca là: <%=item.ListDuLieuChamCongTrongThang[5].SoGioTangCa%>" style="text-align:center;cursor:pointer;<%if(Model.TheHienMauChoNgay ==6){%> background-color:#ffffcc;<%}%>" onclick="javascript:ChamCongNgayHomNay('<%=Model.NgayThu7%>');">
                                        <%=item.ListDuLieuChamCongTrongThang[5].KyHieuChamCong%> / <%=item.ListDuLieuChamCongTrongThang[5].SoGioTangCa%>
                                        </td>
                                         <td class="TableHover" title="<%=item.ListDuLieuChamCongTrongThang[6].TenKyHieu%> và số giờ tăng ca là: <%=item.ListDuLieuChamCongTrongThang[6].SoGioTangCa%>" style="text-align:center;cursor:pointer;<%if(Model.TheHienMauChoNgay ==0 ){%> background-color:#ffffcc;<%}%>" onclick="javascript:ChamCongNgayHomNay('<%=Model.NgayThu8%>');">
                                         <%=item.ListDuLieuChamCongTrongThang[6].KyHieuChamCong%> / <%=item.ListDuLieuChamCongTrongThang[6].SoGioTangCa%>
                                        </td>
                                        </tr>
                                     <%stt++;
                                                }
                                            }
                                        }%>
                                    
                                </tbody>
                                <tfoot>
                                <tr class="border_bottom">
                                   
                                    <td class="last" colspan="10" align="right" style="background: #DDDDDD; padding-right: 10px">
                                        <%
                                            Webdiyer.WebControls.Mvc.PagerOptions pagerOptions = new Webdiyer.WebControls.Mvc.PagerOptions();
                                            DTTB.MV2.QUANLYNHANSUTIENLUONG.BussinessDelegate.CommonDelegate.CommonDelegate CommonDelegate= new  DTTB.MV2.QUANLYNHANSUTIENLUONG.BussinessDelegate.CommonDelegate.CommonDelegate();
                                            CommonDelegate.ChangeTextPaging(pagerOptions, "id");
                                        %>
                                        <div>
                                        <%if (Model.DanhSachNhanVienPagedList != null)
                                          { %>
                                            <%=Html.Pager(Model.DanhSachNhanVienPagedList, pagerOptions, new object())%></div>
                                        <%} %>
                                           
                                        <%=Html.Hidden("PageNumber", Model.PageNumber)%>
                                    </td>
                                </tr>
                            </tfoot>
                            </table>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        </div>

    </div>
    <script type="text/javascript">
        //        //$(document).ready(function () {//initialize the calendar
        //        $('#calendarTest').fullCalendar({
        //            header: {
        //                left: 'prev,next today',
        //                center: 'title',
        //                right: 'month,agendaWeek,agendaDay'
        //            },
        //            editable: true,
        //            droppable: true, // this allows things to be dropped onto the calendar !!!
        //            drop: function (date, allDay) { // this function is called when something is dropped
        //                // retrieve the dropped element's stored Event Object
        //                var originalEventObject = $(this).data('eventObject');
        //                // we need to copy it, so that multiple events don't have a reference to the same object
        //                var copiedEventObject = $.extend({}, originalEventObject);
        //                // assign it the date that was reported
        //                copiedEventObject.start = date;
        //                copiedEventObject.allDay = allDay;
        //                // render the event on the calendar
        //                // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
        //                $('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
        //                // is the "remove after drop" checkbox checked?
        //                if ($('#drop-remove').is(':checked')) {
        //                    // if so, remove the element from the "Draggable Events" list
        //                    $(this).remove();
        //                }
        //            }
        //        }); 
        //        //});
    </script>
</asp:Content>
